﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.utils {

    public class TimeUtils {

        public static function secondsToHoursMin(_arg1:Number):String{
            var _local2:String = secondsToHoursMinSec(_arg1);
            return (_local2.substring(0, (_local2.length - 3)));
        }
        public static function secondsToHoursMinSec(_arg1:Number):String{
            var _local9:String;
            var _local2 = "";
            if (_arg1 < 0){
                _local2 = "-";
            };
            _arg1 = Math.abs(_arg1);
            var _local3:uint = (_arg1 % 60);
            var _local4:uint = ((_arg1 / 60) % 60);
            var _local5:uint = Math.floor((_arg1 / 3600));
            var _local6:String = leadingZeros(_local5, 2);
            var _local7:String = leadingZeros(_local4, 2);
            var _local8:String = leadingZeros(_local3, 2);
            _local9 = (((((_local2 + _local6) + ":") + _local7) + ":") + _local8);
            return (_local9);
        }
        private static function leadingZeros(_arg1:Number, _arg2:int):String{
            var _local3:String = _arg1.toString();
            var _local4:int = _local3.length;
            while (_local4 < _arg2) {
                _local3 = ("0" + _local3);
                _local4++;
            };
            return (_local3);
        }
        public static function getComputerDisplayDurationFormat(_arg1:int, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:String):String{
            var _local7:Number;
            var _local8:int;
            if (_arg1 < 60){
                return (((String(_arg1) + " ") + _arg2));
            };
            _local7 = (_arg1 / 60);
            if (_local7 == 1){
                return (((String((_arg1 / 60)) + " ") + _arg4));
            };
            if (_local7 > 22){
                _local8 = Math.round((_local7 / 24));
                if (_local8 == 1){
                    return (String(((_local8 + " ") + _arg6)));
                };
                return (String(((_local8 + " ") + _arg5)));
            };
            return (((String((_arg1 / 60)) + " ") + _arg3));
        }

    }
}//package net.wooga.pets.utils 
